#include <REGX52.H>
#include "serial.h"
#include <string.h>
#include "Timer.h"

void main(){
	UART_Init();
	Timer_0_Init();
	while(1){
	//	UART_SendReceive();
	}
}

// 提高要求：发送 Hello!Everyone.
// 中断法判断字符串是否相等
void UsART() interrupt 4                                                                                                                                                
{	
	UART_Judge();
}

// 定时器0常规循环
void Timer_0_Rountine() interrupt 1{
	// 设立辅助变量来帮助计数
	static unsigned int count = 0;
	TH0 = (65536 - 50000);
	TL0 = (65536 - 50000);
	count++;
	// 每50ms出发一次中断 故10s时count的值对应为200 届时发送数据并清零
	if(count == 40){
		UART_SendString("Hello!Everyone.");
		count = 0;
	}
}

